import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home'
import HomePage from '@/views/home/homePage'
import Find from '@/views/find/find'
import Receiver from '@/views/receiver/receiver'
// import ArticlesPage from '@/views/articles/articlesPage'
// import Answer from '@/views/articles/answer'
// import Radio from "@/views/articles/radio"
// import ImageText from '@/views/articles/imageText'
// import Topic from '@/views/articles/topic'
// import NotesContent from '@/views/articles/notesContent'
// import HotListDetails from '@/views/articles/hotListDetails'
// import BookShadowContent from '@/views/articles/bookShadowContent'
// import AuthorWork from '@/views/articles/AuthorWork'
// import LongPage from '@/views/articles/longPage'
// import Serialcontent from '@/views/articles/serialcontent'
// import Search from '@/views/search/search'
// import XiaojiSquare from '@/views/articles/XiaojiSquare'

const ArticlesPage =()=>import ('@/views/articles/articlesPage')
const Answer =()=>import ('@/views/articles/answer')
const Radio =()=>import ("@/views/articles/radio")
const ImageText =()=>import ('@/views/articles/imageText')
const Topic =()=>import ('@/views/articles/topic')
const NotesContent =()=>import ('@/views/articles/notesContent')
const HotListDetails =()=>import ('@/views/articles/hotListDetails')
const BookShadowContent =()=>import ('@/views/articles/bookShadowContent')
const AuthorWork =()=>import ('@/views/articles/AuthorWork')
const LongPage =()=>import ('@/views/articles/longPage')
const Serialcontent =()=>import ('@/views/articles/serialcontent')
const Search =()=>import ('@/views/search/search')
const XiaojiSquare =()=>import ('@/views/articles/XiaojiSquare')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home,
    redirect:'/homepage', //重定向
    children:[
      {path:'/homepage',component:HomePage},
      {path:'/find',component:Find,meta:{keepAlive:true}},
      {path:'/receiver',component:Receiver}
    ]
  },
  {
    path:'/articlesPage',component:ArticlesPage
  },
  {
    path:'/answer',component:Answer
  },
  {
    path:'/radio',component:Radio
  },
  {
    path:'/imageText/:id',component:ImageText
  },
  {
    path:'/topic/:id',component:Topic
  },
  {
    path:'/notesContent',component:NotesContent
  },
  {
    path:'/hotListDetails',component:HotListDetails
  },
  {
    path:'/bookShadowContent/:id',component:BookShadowContent
  },
  {
    path:'/authorWork',component:AuthorWork
  },
  {
    path:'/longPage/:id',component:LongPage
  },
  {
    path:'/serialcontent',component:Serialcontent
  },
  {
    path:'/search',component:Search, meta:{keepAlive:true}  
  },
  {
    path:'/XiaojiSquare',component:XiaojiSquare
  }
  
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
